package com.tm.service.impl;

import com.tm.dao.IStudentDao;
import com.tm.dao.impl.StudentDaoImpl;
import com.tm.entity.Student;
import com.tm.service.IStudentService;

import java.util.List;

public class StudentServiceImpl implements IStudentService {

    private IStudentDao isd = new StudentDaoImpl();

    @Override
    public List<Student> getAllStudents() {
        return isd.getAllStudents();
    }

    @Override
    public List<Student> getStudentsByPage(int cp, int ps) {
        return isd.getStudentsByPage(cp, ps);
    }

    @Override
    public Student getStudentBySid(int stuId) {
        return isd.getStudentBySid(stuId);
    }

    @Override
    public boolean saveStudent(Student stu) {
        return isd.saveStudent(stu) > 0;
    }

    @Override
    public boolean deleteStudent(int stuId) {
        return isd.deleteStudent(stuId) > 0;
    }

    @Override
    public boolean updateStudent(Student stu) {
        return isd.updateStudent(stu) > 0;
    }
}
